<?php
/**
 * Created by PhpStorm.
 * User: chenzhitao
 * Date: 2018/4/1
 * Time: 下午3:38
 */

namespace app\wap\controller;


use app\index\model\News;
use app\index\model\SubCategory;
use think\Controller;
use think\Request;

class Consult extends Controller
{
    public function index(){
        return $this->fetch("index");
    }
    
    public function constList($id){
        if($id == null){
            $id = 0;
        }
        $subcategory_name = SubCategory::getCategoryNameById($id);
        $year = config("app.year");
        return $this->fetch("list", ["id"=>$id,"subcategory_name"=>$subcategory_name,"year"=>$year]);
    }
    
    public function constDetail($id){
		if($id == null){
            $id = 0;
        }
         $seo = News::getSeoInfoByID($id);
        $title = $seo['title'];
        $desc = $seo['desc'];
        return $this->fetch("detail",  ["id"=>$id,"title"=>$title,"desc"=>$desc]);
    }
    
}